####
####5/23/07
####DJH
####
### condor_submit_util -i enron022908.R  -f -n 1

library(e1071)
library(ReadMe)
underg <- undergrad(control="/nfs/fs1/projects/poliblog/replication/enron/controlenron.txt",sep=",")
rs <- sample(1:1426,300,replace=F)


source("/nfs/fs1/projects/poliblog/replication/undergrad2.R")
undergff <- undergrad2(control="/nfs/fs1/projects/poliblog/replication/enron/controlenron.txt",sep=",")

underg2 <- underg
underg2$testset <- rbind(underg$testset,underg$trainingset[rs,])
underg2$trainingset <- underg$trainingset[-rs,]


undergff2 <- underg
undergff2$testset <- rbind(undergff$testset,underg$trainingset[rs,])
undergff2$trainingset <- undergff$trainingset[-rs,]

pun <- preprocess(underg2)

rout <- readme(formula=cbind(WORD.perrino+...+WORD.sincer)~TRUTH,pun,n.subset=1000,features=22,boot.se=T,printit=F)
save(rout,file="/nfs/fs1/projects/poliblog/replication/enron/enronout033007.Rdata")
